package common.consts;

/**
 * Created by aceyin on 15/7/15.
 */
public interface Coupons {
    enum Status {
        VALID, INVALID;

        public static boolean isValid(String status) {
            if (status == null) {
                return false;
            }
            return VALID.name().equalsIgnoreCase(status);
        }
    }

    enum Type {
        /* 现金券 */
        CASH,
        /* 月费券 */
        MONTHLY_FEE,
        /* 年费券 */
        YEARLY_FEE;

        public static boolean isCash(String type) {
            if (type == null) {
                throw new IllegalArgumentException("Unknown Coupon Type: " + type);
            }

            return CASH.name().equalsIgnoreCase(type);
        }
    }
}
